package design.mode.effective_java.chapter3.item14;

import java.util.Objects;

/**
 * @author ZhongMingde on 2021/8/13
 */

public final class CaseInsensitiveString implements Comparable<CaseInsensitiveString>{
    private final String s;

    public CaseInsensitiveString(String s) {
        this.s = Objects.requireNonNull(s);
    }

    @Override
    public int compareTo(CaseInsensitiveString cis) {
        return String.CASE_INSENSITIVE_ORDER.compare(s,cis.s);
    }
}
